import { http } from '@/utils/http/axios';

/**
 * @description: 添加角色
 */
export function addRole(params) {
  return http.request({
    url: '/role/add',
    method: 'POST',
    params,
  });
}

/**
 * @description: 查询角色信息
 */
export function roleInfo(params) {
  return http.request({
    url: '/role/info',
    method: 'GET',
    params,
  });
}

/**
 * @description: 编辑角色
 */
export function editRole(params) {
  return http.request({
    url: '/role/update',
    method: 'POST',
    params,
  });
}

/**
 * @description: 删除角色
 */
export function delRole(params) {
  return http.request({
    url: '/role/delete',
    method: 'POST',
    params,
  });
}

/**
 * @description: 角色列表
 */
export function roleList(params?) {
  return http.request({
    url: '/role/pageList',
    method: 'GET',
    params,
  });
}

/**
 * @description: 所有角色列表
 */
export function roleAllList(params?) {
  return http.request({
    url: '/role/getAllRoles',
    method: 'GET',
    params,
  });
}

/**
 * @description: 获取所有权限
 */
export function permissionList() {
  return http.request({
    url: '/role/listAllPermission',
    method: 'GET',
  });
}
